2020-2021 Sunseeker Telemetry and Lighting System
comp_b_ex4_hysteresis.c File Reference
#include "driverlib.h"

Go to the source code of this file.

Functions

void main (void)
 

Function Documentation

◆ main()

void main ( void  )

COMPB - Hysteresis, Output Toggle in LPM4, High Speed Mode

Use CompB and shared reference to determine if input 'Vcompare' is high of low. Shared reference is configured to generate hysteresis. When Vcompare exceeds Vcc*3/4 CBOUT goes high and when Vcompare is less than Vcc*1/4 then CBOUT goes low. Connect P1.6/CBOUT to P1.0 externally to see the LED toggle accordingly.

     MSP430x552x
 -----------------

/|| | | | | –|RST P6.0/CB0|<- Vcompare | P1.6/CBOUT|--> 'high'(Vcompare>Vcc*3/4);'low'(Vcompare<Vcc*1/4) | | | | P1.0|_|LED 'ON'(Vcompare>Vcc*3/4);'OFF'(Vcompare<Vcc*1/4) | |

This example uses the following peripherals and I/O signals. You must review these and change as needed for your own board:

  • COMPB peripheral
  • GPIO Port peripheral
  • CB0
  • CBOUT

This example uses the following interrupt handlers. To use this example in your own application you must add these interrupt handlers to your vector table.

  • None.

Definition at line 66 of file comp_b_ex4_hysteresis.c.

References __delay_cycles(), and __no_operation().